
#pragma once

#include "vehicle.h"

#include <map>
#include <memory>
#include <mutex>

namespace decision::adas {

class RemoteVehicle : public Vehicle {
public:
    explicit RemoteVehicle(int64_t id);

    void calc_relation(const Vehicle& host);
    std::string relation_debug_string() const;

    double get_relative_distance();
    double get_relative_azimuth();
    double get_ttc();
    double get_predicted_min_distance();

private:
    std::map<double, double> distances_;
    std::map<double, decision::math::Vec2d> distances_xy_;
    double rel_speed_ = NAN;
    double distance_ = NAN;
    double azimuth_ = NAN;
    double ttc_ = NAN;
    double predicted_min_distance_ = NAN;

    std::mutex lock_;
};

} // namespace decision::adas
